//
//  EmptyComtView.m
//  JiaoX
//
//  Created by yinqy on 15/1/10.
//  Copyright (c) 2015年 北京娇羞科技有限公司. All rights reserved.
//

#import "EmptyComtView.h"

@implementation EmptyComtView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self setFrame:CGRectMake(0, 0, JXScreenW, 150)];
        
        CGFloat fontSize = [DimensUtils getScaleX:12];
        
        NSString *text = @"暂时没评论";
        UILabel *label = [[UILabel alloc]init];
        [label setText:text];
        [label setFont:[UIFont systemFontOfSize:fontSize]];
        [label setTextColor:JXColor(153, 153, 153)];
        label.size = [text sizeWithFont:[UIFont systemFontOfSize:fontSize]];
        
        self.frame = CGRectMake(0, 0, JXScreenW, 150);
        UIImage *image = [UIImage imageNamed:@"ic_comt_empty"];
        UIImageView *imageView = [[UIImageView alloc]initWithImage:image];
        [imageView setFrame:CGRectMake((self.width-image.size.width)/2, (self.height-image.size.height-JXPublicInset*0.5-label.height)/2, image.size.width, image.size.height)];
        
        label.x = (self.width-label.width)/2;
        label.y = CGRectGetMaxY(imageView.frame)+JXPublicInset/2;
        
        [self addSubview:label];
        [self addSubview:imageView];
    }
    return self;
}

@end
